

  @include('common.header')
    
  <div class="content col-xs-12 col-sm-10">
            <div class="banner">
              <p class="fl"><a href="/contract">合同信息</a> > 修改合同</p>
            </div>
          
            <div class="infoBox">
              <div class="info1">
    @if (count($errors) > 0)
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
  @endif
         <form action="{{ URL('contract/update') }}" method="POST">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <input type="hidden" name="id" value="{{ $contract->id}}">
           <table>
            <tr>
              <td>农户</td>
              <td>
                <select type="text" name="landowner_id" class="form-control" required="required">
                  
                @foreach ($landowners as $landowner)
                @if ($landowner->id ==  $contract->landowner_id)
                  <option value="{{$landowner->id}}" selected>{{$landowner->name}}</option>
                @else
                  <option value="{{$landowner->id}}">{{$landowner->name}}</option>
                @endif

                @endforeach  
              </select>
              </td>
            </tr> 

            <tr>
              <td>编号</td>
              <td><input type="text" name="code" value="{{ $contract->code}}" class="form-control" required="required"></td>
            </tr> 
   
            <tr>
              <td>起始日期</td>
              <td><input type="text" name="start_date" value="{{ $contract->start_date}}" class="form-control" required="required"></td>
            </tr> 

            <tr>
              <td>年限</td>
              <td><input type="text" name="peroid" value="{{ $contract->peroid}}" class="form-control" ></td>
            </tr> 

          <tr>
              <td>金额(元）</td>
              <td><input type="text" name="amount" value="{{ $contract->amount}}" class="form-control" required="required"></td>
            </tr> 
          <tr>
              <td>备注</td>
              <td><input type="text" name="comment" value="{{ $contract->comment}}" class="form-control" ></td>
          </tr> 

 
   
       <tr>
              <td colspan=2><input type="submit" value="修改" class="add"/></td>
            </tr> 

          </table>
                  </form> 
                 
              </div>

            </div>
          
        </div>
      </div>
    </div>

    @include('common.footer')
  
